<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>快乐屋</title>
</head>
<body>
<form action="dataBase.php" method="post" enctype="multipart/form-data">
    请选择头像<br>
    <img src="" id="showImage" width="200px" height="180px">
    <input type="file"  name="up_file" id="file" multiple="multiple"  ><br>
    姓名<br><input type="text" name="Name" value="" placeholder="请输入姓名" ><br>
    特长<br><input type="text" name="speciality " value="" placeholder="请输入您擅长的编程语言"><br>
    性别<br>
    男：<input type="radio" name="sex" value="man">
    女：<input type="radio" name="sex" value="woman"><br>
    公司<br><input type="text" name="company" value="" placeholder="公司地址" ><br>
    职务<br><input type="text" name="post" value="" placeholder="职务"><br>
    微信<br><input type="text" name="wechat" value="" placeholder="微信" ><br>
    QQ<br><input type="text" name="QQ" value="" placeholder="QQ"><br>
    微博<br><input type="text" name="microblog" value="" placeholder="微博地址"><br>
    所在地<br>
    <select name="Province">
        <option>福建</option>
        <option>北京</option>
        <option>广东</option>
    </select>
    <select name="City">
        <option>厦门</option>
        <option>朝阳</option>
        <option>广州</option>
    </select>
    <br>
    自我介绍 <br><textarea style="margin: 0px; width: 334px; height: 166px;" name="self"></textarea>
    <br><br><input type="submit" value="更新" ><br>
</form>
</body>
<script>
    var fileObj = document.getElementById('file');
    function showImage() {

        var files = fileObj['files'];
        var URL = window.URL || window.webkitURL;
        var imgURL = URL.createObjectURL(files[0]);
        document.getElementById('showImage').src = imgURL;
    }
    onload = function(){
        console.log(fileObj)
        fileObj.onchange = showImage;
    }
</script>
</html>